-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay selector evaluates only first location constraint when a custom list is selected #5874
Relay selector evaluates only first location constraint when a custom list is selected #5874
Conversation
6287c3a
to
999ca63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @rablador)
ios/MullvadREST/Relay/RelaySelector.swift
line 157 at r1 (raw file):
return true case let .only(relayConstraint): // At least one location must match the relay under test.
There's a lot of logic in this loop; wouldn't it make sense to move it to RelayLocation, perhaps a RelayWithLocation.matches(Location)
method or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/MullvadREST/Relay/RelaySelector.swift
line 157 at r1 (raw file):
Previously, acb-mv wrote…
There's a lot of logic in this loop; wouldn't it make sense to move it to RelayLocation, perhaps a
RelayWithLocation.matches(Location)
method or similar?
Yeah, that's a good idea I think. I 'll look at it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/MullvadREST/Relay/RelaySelector.swift
line 157 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
Yeah, that's a good idea I think. I 'll look at it 👍
Can you create a test case that fails with the previous version, and is fixed by the changes here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/MullvadREST/Relay/RelaySelector.swift
line 157 at r1 (raw file):
Previously, buggmagnet wrote…
Can you create a test case that fails with the previous version, and is fixed by the changes here ?
Sure thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/MullvadREST/Relay/RelaySelector.swift
line 157 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
Sure thing.
In order to create such a test I need to make this function internal rather than private. I can't rely on on testing evaluate
above, since the result will be random each time.
999ca63
to
382e316
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r2, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @acb-mv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
… when a custom list is selected
382e316
to
7ef5b77
Compare
Fixes the bug by evaluating all locations before returning the result.
This change is